#!/bin/bash
echo -----------------------------------------------
echo ----------------开始安装 -----------------------
echo -------如果安装失败，请检查依赖是否安装-------------
echo ------------ git curl zsh  --------------------
echo -----------------------------------------------

cd $HOME \
&& curl -fsSL https://gitee.com/mirrors/oh-my-zsh/raw/master/tools/install.sh \
| sed 's/github.com/gitee.com/g' \
| sed 's/ohmyzsh\/ohmyzsh/mirrors\/oh-my-zsh/g' \
| bash \
&& git clone https://gitee.com/asddfdf/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting \
&& git clone https://gitee.com/asddfdf/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions \
&& sed -i 's/(git)/(\ngit\nzsh-autosuggestions\nzsh-syntax-highlighting\n)/g' $HOME/.zshrc \
&& sed -i 's/robbyrussell/agnoster/g' $HOME/.zshrc \
&& chsh -s /bin/zsh


echo -------------------
echo -安装完成，请重启终端-
echo -------------------